Fix the block-sharing check for physical devices by using a lock to serialise
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Fri, 2 Dec 2005 15:48:44 +0000 (15:48 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Fri, 2 Dec 2005 15:48:44 +0000 (15:48 +0000)
commitd1dd4f46f5a4fe6cfbe22a6e36d1ad20f3d0e081
treec322b1c4cc84bde3c307ffc2eda10cdb5f09b0b2
parent0bac77637bc1feed41d39d55d77761144c3fb05c
Fix the block-sharing check for physical devices by using a lock to serialise
the check, reading from the store rather than /sys, and checking whether the
VM for apparently-conflicting uses is actually the same (i.e. this is a
migration or a reboot in progress).

This fixes recent failures in 12_block_attach_shared_domU and recloses bug #331.

This fix includes particularly skanky path slicing inside xenbus_probe, which
it would be nice to remove very soon.

The loopback device check still suffers from the problem that filenames over
64 characters long are truncated.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
tools/examples/block